package com.asdan.seededu.util;

import java.util.List;

public class Pager<T> {
	private List<T> datas;
	private int offset;   //当前页
	private int size;   //一页多少数据
	private long total;  //总数量
	private int totalPage ;  //总页数
	
	
	public Pager() {
		this.size = Util.pageCount;
		this.offset = 1;
		this.total = 0;
		this.totalPage = 0 ;
	}
	public int getTotalPage() {
		return totalPage;
	}
	public void setTotalPage(int pageCount) {
			if(pageCount!=0&&pageCount%Util.pageCount>0){
				totalPage = pageCount/Util.pageCount+1;
			}else if(pageCount!=0){
				totalPage =  pageCount/Util.pageCount;
			}
	}
	public List<T> getDatas() {
		return datas;
	}
	public void setDatas(List<T> datas) {
		this.datas = datas;
	}
	public int getOffset() {
		return offset;
	}
	public void setOffset(int offset) {
		this.offset = offset;
	}
	public int getSize() {
		return size;
	}
	public void setSize(int size) {
		this.size = size;
	}
	public long getTotal() {
		return total;
	}
	public void setTotal(long total) {
		this.total = total;
	}
}
